package cn.yougou.controller;


import cn.yougou.common.DtoUtil;
import cn.yougou.dto.Dto;
import cn.yougou.service.admin.YgAdminService;
import com.alibaba.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * (YgAdmin)表控制层
 *
 * @author 白杰崇
 * @since 2020-12-03 01:32:19
 */
@RestController
@RequestMapping("ygAdmin")
public class YgAdminController {

    /**
     * 服务对象
     */
    @Reference
    private YgAdminService ygAdminService;

    /**
     * 通过主键查询单条数据
     *
     * @param id 主键
     * @return 单条数据
     */
    @GetMapping("/selectOne")
    public Dto selectOne(Integer id) {
        return DtoUtil.returnDataSuccess(this.ygAdminService.queryById(id));
    }

    /**
     * 首页
     * @return
     */
    @GetMapping("/countVo")
    public Dto countVo(){
        return DtoUtil.returnDataSuccess(ygAdminService.countVo());
    }


}